/**
* 左边菜单
*/
<template>
  <el-menu default-active="2" :collapse="collapsed" collapse-transition router :default-active="$route.path" unique-opened class="el-menu-vertical-demo" background-color="#334157" text-color="#fff" active-text-color="#ffd04b">
    <div class="logobox">
      <img class="logoimg" src="../assets/img/logo.png" alt="">
    </div>
    <el-submenu v-for="menu in allmenu" :key="menu.menuid" :index="menu.menuname">
      <template slot="title">
        <i class="iconfont" :class="menu.icon"></i>
        <span>{{menu.menuname}}</span>
      </template>
      <el-menu-item-group>
        <el-menu-item v-for="chmenu in menu.menus" :index="'/'+chmenu.url" :key="chmenu.menuid">
          <i class="iconfont" :class="chmenu.icon"></i>
          <span>{{chmenu.menuname}}</span>
        </el-menu-item>
      </el-menu-item-group>
    </el-submenu>
  </el-menu>
</template>
<script>
import { menu } from '../api/userMG'
export default {
  name: 'leftnav',
  data() {
    return {
      collapsed: false,
      allmenu: []
    }
  },
  // 创建完毕状态(里面是操作)
  created() {
    // 获取图形验证码
    let res = {
      success: true,
      data: [
        {
          menuid: 1,
          icon: 'li-icon-xiangmuguanli',
          menuname: '基础管理',
          hasThird: null,
          url: null,
          menus: [

            {
              menuid: 274,
              icon: 'icon-cms-manage',
              menuname: '学历管理',
              hasThird: 'N',
              url: 'system/RecruitmentEducation',
              menus: null
            },
            {
              menuid: 56,
              icon: 'icon-cus-manage',
              menuname: '工作时间基础表',
              hasThird: 'N',
              url: 'system/JobHoursBasice',
              menus: null
            },
            // {
            //   menuid: 104,
            //   icon: 'icon-cat-skuQuery',
            //   menuname: '行业管理',
            //   hasThird: 'N',
            //   url: 'goods/Industry',
            //   menus: null
            // },

            {
              menuid: 281,
              icon: 'icon-cms-manage',
              menuname: '工作经验管理',
              hasThird: 'N',
              url: 'system/WorkExperience',
              menus: null
            },
            {
              menuid: 555,
              icon: 'icon-cus-manage',
              menuname: '融资阶段表',
              hasThird: 'N',
              url: 'system/FinancingStage',
              menus: null
            },
            {
              menuid: 456,
              icon: 'icon-cms-manage',
              menuname: '婚姻管理',
              hasThird: 'N',
              url: 'system/MaritalStatus',
              menus: null
            },

            {
              menuid: 351,
              icon: 'icon-cms-manage',
              menuname: '民族管理',
              hasThird: 'N',
              url: 'system/Nation',
              menus: null
            },
            {
              menuid: 2,
              icon: 'icon-cat-skuQuery',
              menuname: '商品管理',
              hasThird: 'N',
              url: 'goods/Goods',
              menus: null
            },

          ]
        },
        {
          menuid: 399,
          icon: 'li-icon-dingdanguanli',
          menuname: '公司管理',
          hasThird: null,
          url: null,
          menus: [
            {
              menuid: 357,
              icon: 'icon-cms-manage',
              menuname: '公司信息',
              hasThird: 'N',
              url: 'system/Company',
              menus: null
            },
            {
              menuid: 353,
              icon: 'icon-cms-manage',
              menuname: '发布人信息',
              hasThird: 'N',
              url: 'system/Publisher',
              menus: null
            },
            {
              menuid: 782,
              icon: 'icon-order-manage',
              menuname: '公司相关照片',
              hasThird: 'N',
              url: 'company/companyPic',
              menus: null
            },

            {
              menuid: 579,
              icon: 'icon-cus-manage',
              menuname: '公司福利标签表',
              hasThird: 'N',
              url: 'system/CompanyWelfareLabelBasics',
              menus: null
            },
            {
              menuid: 282,
              icon: 'icon-cms-manage',
              menuname: '招聘信息发布管理',
              hasThird: 'N',
              url: 'system/RecruitmentPost',
              menus: null
            },
            {
              menuid: 688,
              icon: 'icon-cus-manage',
              menuname: '公司工作时间表',
              hasThird: 'N',
              url: 'system/CompanyJobHoursBasice',
              menus: null
            },
            {
              menuid: 689,
              icon: 'icon-cus-manage',
              menuname: '公司产品介绍表',
              hasThird: 'N',
              url: 'system/CompanyProductIntroduction',
              menus: null
            },

            {
              menuid: 278,
              icon: 'icon-cms-manage',
              menuname: '基础福利标签管理',
              hasThird: 'N',
              url: 'system/WelfareLabelBasics',
              menus: null
            },
            {
              menuid: 365,
              icon: 'icon-cat-skuQuery',
              menuname: '公司类型管理',
              hasThird: 'N',
              url: 'system/CompanyType',
              menus: null
            },
          ]
        },
        {
          menuid: 71,
          icon: 'li-icon-xitongguanli',
          menuname: '用户管理',
          hasThird: null,
          url: null,
          menus: [
            // {
            //   menuid: 72,
            //   icon: 'icon-cus-manage',
            //   menuname: '用户管理',
            //   hasThird: 'N',
            //   url: 'system/user',
            //   menus: null
            // },
            {
              menuid: 789,
              icon: 'icon-cus-manage',
              menuname: '教育经历基础表',
              hasThird: 'N',
              url: 'system/EducationalExperience',
              menus: null
            },
            {
              menuid: 987,
              icon: 'icon-cus-manage',
              menuname: '工作经历表',
              hasThird: 'N',
              url: 'system/JobExperience',
              menus: null
            },


            {
              menuid: 279,
              icon: 'icon-cms-manage',
              menuname: '项目经历表管理',
              hasThird: 'N',
              url: 'system/ProjectExperience',
              menus: null
            },

            {
              menuid: 33,
              icon: 'icon-cms-manage',
              menuname: '用户注册',
              hasThird: 'N',
              url: 'system/UserInfo',
              menus: null
            },
            {
              menuid: 336,
              icon: 'icon-cms-manage',
              menuname: '入职时间管理',
              hasThird: 'N',
              url: 'system/Entrytime',
              menus: null
            },
            {
              menuid: 356,
              icon: 'icon-cms-manage',
              menuname: '求职管理',
              hasThird: 'N',
              url: 'system/NatureWork',
              menus: null
            },





          ]
        },
        {
          menuid: 187,
          icon: 'li-icon-xiangmuguanli',
          menuname: '系统管理',
          hasThird: null,
          url: null,
          menus: [
            {
              menuid: 73,
              icon: 'icon-news-manage',
              menuname: '所有管理员',
              hasThird: 'N',
              url: 'system/Role',
              menus: null
            },
            {
              menuid: 270,
              icon: 'icon-cms-manage',
              menuname: '用户简历浏览记录表',
              hasThird: 'N',
              url: 'system/ResumViewHistory',
              menus: null
            },
            {
              menuid: 104,
              icon: 'icon-cat-skuQuery',
              menuname: '行业管理',
              hasThird: 'N',
              url: 'goods/Industry',
              menus: null
            },
            {
              menuid: 105,
              icon: 'icon-cat-skuQuery',
              menuname: '主职位类型管理',
              hasThird: 'N',
              url: 'goods/PositionType',
              menus: null
            },
            {
              menuid: 106,
              icon: 'icon-cat-skuQuery',
              menuname: '职位信息管理',
              hasThird: 'N',
              url: 'goods/Position',
              menus: null
            },
            {
              menuid: 192,
              icon: 'icon-news-manage',
              menuname: '操作日志',
              hasThird: 'N',
              url: 'system/Log',
              menus: null
            },

            // {
            //   menuid: 75,
            //   icon: 'icon-promotion-manage',
            //   menuname: '系统环境变量',
            //   hasThird: 'N',
            //   url: 'system/Variable',
            //   menus: null
            // },
            // {
            //   menuid: 76,
            //   icon: 'icon-cms-manage',
            //   menuname: '权限管理',
            //   hasThird: 'N',
            //   url: 'system/Permission',
            //   menus: null
            // },
            // {
            //   menuid: 174,
            //   icon: 'icon-cms-manage',
            //   menuname: '菜单管理',
            //   hasThird: 'N',
            //   url: 'system/Module',
            //   menus: null
            // },
            // {
            //   menuid: 74,
            //   icon: 'icon-cs-manage',
            //   menuname: '公司管理',
            //   hasThird: 'N',
            //   url: 'system/Dept',
            //   menus: null
            // },
          ]
        },
        {
          menuid: 128,
          icon: 'li-icon-shangchengxitongtubiaozitihuayuanwenjian91',
          menuname: '支付管理',
          hasThird: null,
          url: null,
          menus: [
            {
              menuid: 129,
              icon: 'icon-provider-manage',
              menuname: '支付配置信息',
              hasThird: 'N',
              url: 'machine/MachineConfig',
              menus: null
            },
            {
              menuid: 175,
              icon: 'icon-provider-manage',
              menuname: '支付配置',
              hasThird: 'N',
              url: 'pay/Config',
              menus: null
            }
          ]
        },
        {
          menuid: 150,
          icon: 'li-icon-shangchengxitongtubiaozitihuayuanwenjian91',
          menuname: '图表',
          hasThird: null,
          url: null,
          menus: [
            {
              menuid: 159,
              icon: 'icon-provider-manage',
              menuname: '数据可视化',
              hasThird: 'N',
              url: 'charts/statistics',
              menus: null
            }
          ]
        }
      ],
      msg: 'success'
    }
          this.allmenu = res.data


    // 监听
    this.$root.Bus.$on('toggle', value => {
      this.collapsed = !value
    })
  }
}
</script>
<style>
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 240px;
  min-height: 400px;
}
.el-menu-vertical-demo:not(.el-menu--collapse) {
  border: none;
  text-align: left;
}
.el-menu-item-group__title {
  padding: 0px;
}
.el-menu-bg {
  background-color: #1f2d3d !important;
}
.el-menu {
  border: none;
}
.logobox {
  height: 40px;
  line-height: 40px;
  color: #9d9d9d;
  font-size: 20px;
  text-align: center;
  padding: 20px 0px;
}
.logoimg {
  height: 40px;
}
</style>
